import { dbManger } from "@/utils/db/dbManger";
import { DBKey } from "@/const";
import { useAppStore } from "@/store";
import { toObj, nilV } from "utils";
import type { App } from "vue";
import type { AppUser } from "@/typings/app";
function appDidLaunch(app: App<any>) {
    const appStore = useAppStore();
    // 要初始化 数据
    let info = dbManger.get({ key: DBKey.user, h5Store: "local", _type: "sync" });
    let user = toObj(info);
    if (!nilV(user)) {
        let appUser = user as AppUser;
        // 说明已经登录过了
        // 也扔到 store上
        appStore.updateAppUser(appUser);
    }
}

export default appDidLaunch;
